home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / lib / alib / dicecache.a < prev    next >
Text File  |  1994-02-01  |  1KB  |  52 lines

  1.  
  2.             ;   autoinit if you ever reference DiceCache.library
  3.             ;
  4.             ;   (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  5.             ;
  6.             ;   can't use pc-relative between different code sections
  7.             ;   and cannot put string in autoinit section!
  8.             ;
  9.             ;   As with the ARexx support, this does not abort
  10.             ;   if the library cannot be found.  Furthermore,
  11.             ;   this routine only opens the library if it
  12.             ;   already exists (i.e. cache explicitly turned on)
  13.  
  14.             xdef    _DiceCacheBase
  15.             xref    __AutoFail0
  16.  
  17. _LVOOpenLibrary     equ    -552
  18. _LVOCloseLibrary    equ    -414
  19. _LVOFindName        equ    -276
  20. LibListOffset        equ    378
  21.  
  22.             section autoinit0,code
  23.  
  24.             lea    LibListOffset(A6),A0    ; LibList
  25.             lea    dcname(pc),A1           ; library name
  26.             jsr    _LVOFindName(A6)
  27.             tst.l    D0
  28.             beq    i10
  29.             lea    dcname(pc),A1           ; library name
  30.             moveq.l #0,D0
  31.             jsr    _LVOOpenLibrary(A6)
  32.             move.l    D0,_DiceCacheBase(A4)
  33.             bra    i10
  34. dcname            dc.b    'dicecache.library',0
  35.             ds.w    0
  36. i10
  37.  
  38.             section autoexit0,code
  39.  
  40.             move.l    _DiceCacheBase(A4),D0
  41.             beq    l10
  42.             move.l    D0,A1
  43.             jsr    _LVOCloseLibrary(A6)
  44. l10
  45.  
  46.             section libbss,bss
  47.  
  48. _DiceCacheBase        ds.l    1
  49.  
  50.             END
  51.  
  52.